﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tao.OpenGl;

namespace TaoFrm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            simpleOpenGlControl1.InitializeContexts();
            InitializeGl();
        }

        private void InitializeGl()
        {
          
            TetraDisplay.Init();
            TetraDisplay.Reshape(simpleOpenGlControl1.Width,
                simpleOpenGlControl1.Height);
        }

        private void simpleOpenGlControl1_Paint(object sender, PaintEventArgs e)
        {
            TetraDisplay.Display();
        }

        private void simpleOpenGlControl1_Resize(object sender, EventArgs e)
        {
            TetraDisplay.Reshape(simpleOpenGlControl1.Width,
                simpleOpenGlControl1.Height);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Refresh();
        }

        private void simpleOpenGlControl1_KeyDown(object sender, KeyEventArgs e)
        {
            Refresh();
        }

        private void simpleOpenGlControl1_MouseDown(object sender, MouseEventArgs e)
        {
            var pt = e.Location;
            var pt2 = Cursor.Position;
            var screenCoordinates = PointToScreen(pt);
        }
    }
}
